// 题目来源:https://iai.sh.cn/problem/556
#include <bits/stdc++.h>
using namespace std;

int main() {

  string s;
  cin >> s;
  int ge = (s[3] - '0' + 5) % 10;
  int shi = (s[2] - '0' + 5) % 10;
  int bai = (s[1] - '0' + 5) % 10;
  int qian = (s[0] - '0' + 5) % 10;

  cout << ge << shi << bai << qian;

  return 0;
}